Skip to content

[Automatic Import] Add Error handling framework#193577

Merged
bhapas merged 16 commits intoelastic:mainfrom
bhapas:automatic_import_improve_error_logging
Sep 25, 2024
Merged

[Automatic Import] Add Error handling framework#193577
bhapas merged 16 commits intoelastic:mainfrom
bhapas:automatic_import_improve_error_logging

Conversation

@bhapas
Copy link
Copy Markdown
Contributor

@bhapas bhapas commented Sep 20, 2024

Release Note

Adds error handling framework that provides error message with more context to user.

Summary

Relates - 192916

This PR adds an error handling framework.

  • Add Error classes for specific error scenarios.
  • If the error caught is of the predefined Error type the message and errorCode is sent back to UI from server.
  • The original error message is used to track telemetry and the errorCode can be translated into a User visible error.
  • If there is any non-predefined error server still throws a badRequest with the error message.

This PR also adds/updates the graph images for different langgraphs

Screenshots for error messages

image image

Checklist

For maintainers

@bhapas bhapas added enhancement New value added to drive a business result release_note:feature Makes this part of the condensed release notes Team:Security-Scalability Security Integrations Scalability Team Feature:AutomaticImport labels Sep 20, 2024
@bhapas bhapas self-assigned this Sep 20, 2024
@bhapas bhapas force-pushed the automatic_import_improve_error_logging branch from 2a6bed6 to 6486b9c Compare September 24, 2024 08:34
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamiehynds Need a better wording here.

@bhapas bhapas marked this pull request as ready for review September 24, 2024 08:43
@bhapas bhapas requested a review from a team as a code owner September 24, 2024 08:43
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-scalability (Team:Security-Scalability)

@bhapas bhapas marked this pull request as draft September 24, 2024 08:43
@bhapas bhapas added the backport:skip This PR does not require backporting label Sep 24, 2024
@bhapas bhapas force-pushed the automatic_import_improve_error_logging branch from 6486b9c to 73106e0 Compare September 24, 2024 08:44
@bhapas bhapas marked this pull request as ready for review September 24, 2024 12:47
@bhapas bhapas force-pushed the automatic_import_improve_error_logging branch from 81d7d9a to a568412 Compare September 24, 2024 12:50
@bhapas bhapas requested a review from semd September 24, 2024 13:29
Comment thread x-pack/plugins/integration_assistant/common/constants.ts Outdated
@bhapas bhapas requested a review from semd September 25, 2024 11:53
Comment thread x-pack/plugins/integration_assistant/server/routes/routes_util.ts Outdated
Copy link
Copy Markdown
Contributor

@semd semd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Copy Markdown
Member

@P1llus P1llus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great!

@bhapas bhapas added backport:prev-minor and removed backport:skip This PR does not require backporting labels Sep 25, 2024
@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
integrationAssistant 947.9KB 948.8KB +919.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
integrationAssistant 7 8 +1

Total ESLint disabled count

id before after diff
integrationAssistant 12 13 +1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @bhapas

@bhapas bhapas merged commit 9fb6f55 into elastic:main Sep 25, 2024
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 25, 2024
## Release Note

Adds error handling framework that provides error message with more
context to user.

## Summary

Relates - [192916](elastic#192916)

This PR adds an error handling framework.
- Add Error classes for specific error scenarios.
- If the error caught is of the predefined Error type the `message` and
`errorCode` is sent back to UI from server.
- The original error message is used to track telemetry and the
errorCode can be translated into a User visible error.
- If there is any non-predefined error server still throws a
`badRequest` with the error message.

This PR also adds/updates the graph images for different langgraphs

## Screenshots for error messages
<img width="690" alt="image"
src="https://github.com/user-attachments/assets/bb848ce7-e474-4e4e-8d07-59b534c543ea">

<img width="691" alt="image"
src="https://github.com/user-attachments/assets/fbf4cf46-9bbe-4c37-aaaa-0ede1cdcba7c">

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit 9fb6f55)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Sep 26, 2024
)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Automatic Import] Add Error handling framework
(#193577)](#193577)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Bharat
Pasupula","email":"123897612+bhapas@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-09-25T14:24:01Z","message":"[Automatic
Import] Add Error handling framework (#193577)\n\n## Release
Note\r\n\r\nAdds error handling framework that provides error message
with more\r\ncontext to user.\r\n\r\n## Summary\r\n\r\nRelates -
[192916](https://github.com/elastic/kibana/issues/192916)\r\n\r\nThis PR
adds an error handling framework.\r\n- Add Error classes for specific
error scenarios.\r\n- If the error caught is of the predefined Error
type the `message` and\r\n`errorCode` is sent back to UI from
server.\r\n- The original error message is used to track telemetry and
the\r\nerrorCode can be translated into a User visible error.\r\n- If
there is any non-predefined error server still throws a\r\n`badRequest`
with the error message.\r\n\r\nThis PR also adds/updates the graph
images for different langgraphs\r\n\r\n## Screenshots for error
messages\r\n<img width=\"690\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/bb848ce7-e474-4e4e-8d07-59b534c543ea\">\r\n\r\n<img
width=\"691\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/fbf4cf46-9bbe-4c37-aaaa-0ede1cdcba7c\">\r\n\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"9fb6f5582220148820fb6b83880539f8df0b0841","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["enhancement","v9.0.0","release_note:feature","backport:prev-minor","Team:Security-Scalability","Feature:AutomaticImport"],"title":"[Automatic
Import] Add Error handling
framework","number":193577,"url":"https://github.com/elastic/kibana/pull/193577","mergeCommit":{"message":"[Automatic
Import] Add Error handling framework (#193577)\n\n## Release
Note\r\n\r\nAdds error handling framework that provides error message
with more\r\ncontext to user.\r\n\r\n## Summary\r\n\r\nRelates -
[192916](https://github.com/elastic/kibana/issues/192916)\r\n\r\nThis PR
adds an error handling framework.\r\n- Add Error classes for specific
error scenarios.\r\n- If the error caught is of the predefined Error
type the `message` and\r\n`errorCode` is sent back to UI from
server.\r\n- The original error message is used to track telemetry and
the\r\nerrorCode can be translated into a User visible error.\r\n- If
there is any non-predefined error server still throws a\r\n`badRequest`
with the error message.\r\n\r\nThis PR also adds/updates the graph
images for different langgraphs\r\n\r\n## Screenshots for error
messages\r\n<img width=\"690\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/bb848ce7-e474-4e4e-8d07-59b534c543ea\">\r\n\r\n<img
width=\"691\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/fbf4cf46-9bbe-4c37-aaaa-0ede1cdcba7c\">\r\n\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"9fb6f5582220148820fb6b83880539f8df0b0841"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193577","number":193577,"mergeCommit":{"message":"[Automatic
Import] Add Error handling framework (#193577)\n\n## Release
Note\r\n\r\nAdds error handling framework that provides error message
with more\r\ncontext to user.\r\n\r\n## Summary\r\n\r\nRelates -
[192916](https://github.com/elastic/kibana/issues/192916)\r\n\r\nThis PR
adds an error handling framework.\r\n- Add Error classes for specific
error scenarios.\r\n- If the error caught is of the predefined Error
type the `message` and\r\n`errorCode` is sent back to UI from
server.\r\n- The original error message is used to track telemetry and
the\r\nerrorCode can be translated into a User visible error.\r\n- If
there is any non-predefined error server still throws a\r\n`badRequest`
with the error message.\r\n\r\nThis PR also adds/updates the graph
images for different langgraphs\r\n\r\n## Screenshots for error
messages\r\n<img width=\"690\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/bb848ce7-e474-4e4e-8d07-59b534c543ea\">\r\n\r\n<img
width=\"691\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/fbf4cf46-9bbe-4c37-aaaa-0ede1cdcba7c\">\r\n\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"9fb6f5582220148820fb6b83880539f8df0b0841"}}]}]
BACKPORT-->

Co-authored-by: Bharat Pasupula <123897612+bhapas@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New value added to drive a business result Feature:AutomaticImport release_note:feature Makes this part of the condensed release notes Team:Security-Scalability Security Integrations Scalability Team v8.16.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants